package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.Category;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Mapper
public interface CategoryMapper {
@AutoFill(OperationType.INSERT)
    public void save(Category category);
@AutoFill(OperationType.UPDATE)
    void update(Category category);

    List<Category> page(String name, Integer type);
@Delete("delete from category where id=#{id}")
    void delete(Integer id);
@Select("select * from category where type=#{type}")
    List<Category> getList(Integer type);
}
